﻿<phone:PhoneApplicationPage 
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:System="clr-namespace:System;assembly=mscorlib"
	mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
	x:Class="MyDeeWeibo.DeeTimeline"
	Orientation="Portrait"
	shell:SystemTray.IsVisible="True"
    Loaded="PhoneApplicationPage_Loaded"
    DataContext="{Binding RelativeSource={RelativeSource Self}}">

    <phone:PhoneApplicationPage.Resources>
        <DataTemplate x:Key="CommentTemplateComplex">
            <Grid Margin="0,12,8,10" UseLayoutRounding="True">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <StackPanel x:Name="LeftPanel" Orientation="Vertical" d:LayoutOverrides="Height" Margin="0,0,8,0">
                    <Border x:Name="ProfileBorder" BorderThickness="1" Width="64" Height="64" HorizontalAlignment="Left" VerticalAlignment="Top" BorderBrush="{StaticResource TransparentBrush}">
                        <Canvas Margin="0">
                            <Image x:Name="ProfileImage" Source="{Binding user.profile_image_url}" Height="56" Width="56" Canvas.Left="2" Canvas.Top="2"/>
                            <Image x:Name="VerifyLogo" Height="20" Width="20" Canvas.Left="45" Canvas.Top="45" Source="/Resources/Images/SinaResource.Verifier.png" Visibility="{Binding user.IsVerified}" Stretch="UniformToFill"/>
                        </Canvas>
                    </Border>
                </StackPanel>

                <StackPanel x:Name="RightPanel" Grid.Column="1" Grid.Row="0" Margin="0" Orientation="Vertical" d:LayoutOverrides="Height" >
                    <Grid x:Name="HeaderGrid" Margin="0,0,0,10" UseLayoutRounding="True" Height="30">
                        <Grid.Background>
                            <LinearGradientBrush EndPoint="1,0.5" SpreadMethod="Reflect" StartPoint="0,0.5">
                                <GradientStop Color="{Binding Source={StaticResource AppSettings}, Path=colorSaved}" Offset="0"/>
                                <GradientStop Color="White" Offset="1"/>
                            </LinearGradientBrush>
                        </Grid.Background>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock x:Name="UserName" Height="30" Margin="-10" FontSize="20" Text="{Binding user.name}" Padding="10,0" FontWeight="Bold" Foreground="{StaticResource PhoneBackgroundBrush}" LineHeight="16" />
                        <TextBlock x:Name="CreateTimeBlock" Text="{Binding CreatedAt}" FontSize="20" VerticalAlignment="Bottom" Grid.Column="1" Foreground="{StaticResource PhoneTextBoxReadOnlyBrush}" Margin="0" Height="30"/>
                    </Grid>
                    <StackPanel>
                        <TextBlock x:Name="StatusBlock" Text="{Binding text}" TextWrapping="Wrap" FontSize="21.333" Foreground="{StaticResource PhoneBackgroundBrush}"  />
                        <Image x:Name="ThumbImage" Source="{Binding thumbnail_pic}" HorizontalAlignment="Left" Stretch="Uniform" Height="120" Visibility="{Binding IsThumbnail}" Margin="0,12,0,0" VerticalAlignment="Top"/>
                    </StackPanel >
                    <Border x:Name="StatusBorder" Margin="0,12,0,0" Padding="8,12" Visibility="Visible" CornerRadius="10" BorderThickness="1" Background="#FFEDEDED" BorderBrush="#FFC2C2C2">
                        <StackPanel>
                            <TextBlock x:Name="StatusUserBlock" TextWrapping="Wrap" Text="{Binding status.user.name}" Margin="0,0,0,10" Foreground="{StaticResource PhoneBackgroundBrush}" FontWeight="Bold"/>
                            <TextBlock x:Name="StatusContentBlock" TextWrapping="Wrap" Text="{Binding status.text}" Foreground="{StaticResource PhoneBackgroundBrush}"/>
                            <Image x:Name="StatusThumbImage" 
                                   Margin="0,12,0,0" 
                                   Stretch="Uniform" 
                                   Source="{Binding status.thumbnail_pic}" 
                                   Visibility="{Binding status.IsThumbnail}" 
                                   HorizontalAlignment="Left" 
                                   VerticalAlignment="Top" 
                                   Height="120"/>
                        </StackPanel>
                    </Border>
                </StackPanel>

                <Grid x:Name="FooterGrid" Margin="0,12,0,0" Grid.Row="1" Grid.Column="1">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <StackPanel x:Name="SourcePanel" Orientation="Horizontal" HorizontalAlignment="Left" d:LayoutOverrides="HorizontalAlignment, GridBox">
                        <Image x:Name="StatusPicHint" Source="/Resources/Images/Status_Pic.png" Visibility="{Binding IsThumbnail}" Margin="0,0,0,-2" Width="30"/>
                        <TextBlock x:Name="SourceBlock"
                        	Text="{Binding Source}" 
                        	d:LayoutOverrides="Width" 
                        	HorizontalAlignment="Left" 
                        	VerticalAlignment="Bottom" 
                        	FontSize="18.667" Foreground="{StaticResource PhoneTextBoxReadOnlyBrush}"/>
                    </StackPanel>
                </Grid>

                <Path x:Name="Separater" Data="M0,80 L448,80" Height="1" Margin="0" Grid.Row="2" Grid.ColumnSpan="2" Stretch="Fill" UseLayoutRounding="False" VerticalAlignment="Top" HorizontalAlignment="Center">
                    <Path.Stroke>
                        <SolidColorBrush Color="{StaticResource PhoneForegroundColor}"/>
                    </Path.Stroke>
                </Path>
            </Grid>
        </DataTemplate>
        <DataTemplate x:Key="FavoritesTemplateComplex">
            <Grid Margin="0,12,8,10">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <StackPanel x:Name="LeftPanel" Orientation="Vertical" d:LayoutOverrides="Height" Margin="0,0,8,0">
                    <Border x:Name="ProfileBorder" BorderThickness="1" Width="64" Height="64" HorizontalAlignment="Left" VerticalAlignment="Top" BorderBrush="{StaticResource TransparentBrush}">
                        <Canvas Margin="0">
                            <Image x:Name="ProfileImage" Source="{Binding status.user.profile_image_url}" Height="56" Width="56" Canvas.Left="2" Canvas.Top="2"/>
                            <Image x:Name="VerifyLogo" Height="20" Width="20" Canvas.Left="45" Canvas.Top="45" Source="/Resources/Images/SinaResource.Verifier.png" Visibility="{Binding status.user.IsVerified}" Stretch="UniformToFill"/>
                        </Canvas>
                    </Border>
                </StackPanel>

                <StackPanel x:Name="RightPanel" Grid.Column="1" Grid.Row="0" Margin="0" Orientation="Vertical" d:LayoutOverrides="Height" >
                    <Grid x:Name="HeaderGrid" Margin="0,0,0,10" UseLayoutRounding="True" Height="30">
                        <Grid.Background>
                            <LinearGradientBrush EndPoint="1,0.5" SpreadMethod="Reflect" StartPoint="0,0.5">
                                <GradientStop Color="{Binding Source={StaticResource AppSettings}, Path=colorSaved}" Offset="0"/>
                                <GradientStop Color="White" Offset="1"/>
                            </LinearGradientBrush>
                        </Grid.Background>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock x:Name="UserName" Height="30" Margin="-10" FontSize="20" Text="{Binding status.user.name}" Padding="10,0" FontWeight="Bold" Foreground="{StaticResource PhoneBackgroundBrush}" LineHeight="16" />
                        <TextBlock x:Name="CreateTimeBlock" Text="{Binding status.CreatedAt}" FontSize="20" VerticalAlignment="Bottom" Grid.Column="1" Foreground="{StaticResource PhoneTextBoxReadOnlyBrush}" Margin="0" Height="30"/>
                    </Grid>
                    <TextBlock x:Name="StatusBlock" Text="{Binding status.text}" TextWrapping="Wrap" FontSize="21.333" Foreground="{StaticResource PhoneBackgroundBrush}" />
                    <Image x:Name="ThumbImage" Source="{Binding status.thumbnail_pic}" HorizontalAlignment="Left" Stretch="Uniform" Visibility="{Binding status.IsThumbnail}" Margin="0,12,0,0" VerticalAlignment="Top" Height="120"/>
                    <Border x:Name="RetweetBorder" Margin="0,12,0,0" Padding="8,12" Visibility="{Binding status.IsRetweetedStatus}" CornerRadius="10" BorderThickness="1" Background="#FFEDEDED" BorderBrush="#FFC2C2C2">
                        <StackPanel>
                            <TextBlock x:Name="RetweetUserBlock" TextWrapping="Wrap" Text="{Binding status.retweeted_status.user.name}" Margin="0,0,0,10" Foreground="{StaticResource PhoneBackgroundBrush}" FontWeight="Bold"/>
                            <TextBlock x:Name="RetweetStatusBlock" TextWrapping="Wrap" Text="{Binding status.retweeted_status.text}" Foreground="{StaticResource PhoneBackgroundBrush}"/>
                            <Image x:Name="RetweetThumbImage" 
                                   Margin="0,12,0,0" 
                                   Stretch="Uniform" 
                                   Source="{Binding status.retweeted_status.thumbnail_pic}" 
                                   Visibility="{Binding status.retweeted_status.IsThumbnail}" 
                                   HorizontalAlignment="Left" 
                                   VerticalAlignment="Top" 
                                   Height="120"/>
                        </StackPanel>
                    </Border>
                </StackPanel>

                <Grid x:Name="FooterGrid" Margin="0,12,0,0" Grid.Row="1" Grid.Column="1">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <StackPanel x:Name="SourcePanel" Orientation="Horizontal" HorizontalAlignment="Left" d:LayoutOverrides="HorizontalAlignment, GridBox">
                        <Image x:Name="StatusPicHint" Source="/Resources/Images/Status_Pic.png" Visibility="{Binding status.IsThumbnail}" Margin="0,0,0,-2" Width="30"/>
                        <TextBlock x:Name="SourceBlock"
                        	Text="{Binding status.Source}" 
                        	d:LayoutOverrides="Width" 
                        	HorizontalAlignment="Left" 
                        	VerticalAlignment="Bottom" 
                        	FontSize="18.667" Foreground="{StaticResource PhoneTextBoxReadOnlyBrush}"/>
                        <Image x:Name="StatusComment" Source="/Resources/Images/Status_Comment.png" Margin="0,0,0,-2" Width="30"/>
                        <TextBlock x:Name="CommentCount"
    						Text="{Binding status.comments_count}" 
    						d:LayoutOverrides="Width" 
    						HorizontalAlignment="Left" 
    						VerticalAlignment="Bottom" 
    						FontSize="18.667" Foreground="{StaticResource PhoneTextBoxReadOnlyBrush}"/>
                        <Image x:Name="StatusRepost" Source="/Resources/Images/Status_Repost.png" Margin="0,0,0,-2" Width="30"/>
                        <TextBlock x:Name="RepostCount"
    						Text="{Binding status.reposts_count}" 
    						d:LayoutOverrides="Width" 
    						HorizontalAlignment="Left" 
    						VerticalAlignment="Bottom" 
    						FontSize="18.667" Foreground="{StaticResource PhoneTextBoxReadOnlyBrush}"/>
                    </StackPanel>
                </Grid>

                <Path x:Name="Separater" Data="M0,80 L448,80" Height="1" Margin="0" Grid.Row="2" Grid.ColumnSpan="2" Stretch="Fill" UseLayoutRounding="False" VerticalAlignment="Top" HorizontalAlignment="Center">
                    <Path.Stroke>
                        <SolidColorBrush Color="{StaticResource PhoneForegroundColor}"/>
                    </Path.Stroke>
                </Path>
            </Grid>
        </DataTemplate>
        <DataTemplate x:Key="StatusTemplateComplex">
            <Grid Margin="0,12,8,10">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <StackPanel x:Name="LeftPanel" Orientation="Vertical" d:LayoutOverrides="Height" Margin="0,0,8,0">
                    <Border x:Name="ProfileBorder" BorderThickness="1" Width="64" Height="64" HorizontalAlignment="Left" VerticalAlignment="Top" BorderBrush="{StaticResource TransparentBrush}">
                        <Canvas Margin="0">
                            <Image x:Name="ProfileImage" Source="{Binding user.profile_image_url}" Height="56" Width="56" Canvas.Left="2" Canvas.Top="2"/>
                            <Image x:Name="VerifyLogo" Height="20" Width="20" Canvas.Left="45" Canvas.Top="45" Source="/Resources/Images/SinaResource.Verifier.png" Visibility="{Binding user.IsVerified}" Stretch="UniformToFill"/>
                        </Canvas>
                    </Border>
                </StackPanel>

                <StackPanel x:Name="RightPanel" Grid.Column="1" Grid.Row="0" Margin="0" Orientation="Vertical" d:LayoutOverrides="Height" >
                    <Grid x:Name="HeaderGrid" Margin="0,0,0,10" UseLayoutRounding="True" Height="30">
                        <Grid.Background>
                            <LinearGradientBrush EndPoint="1,0.5" SpreadMethod="Reflect" StartPoint="0,0.5">
                                <GradientStop Color="{Binding Source={StaticResource AppSettings}, Path=colorSaved}" Offset="0"/>
                                <GradientStop Color="White" Offset="1"/>
                            </LinearGradientBrush>
                        </Grid.Background>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock x:Name="UserName" Height="30" Margin="-10" FontSize="20" Text="{Binding user.name}" Padding="10,0" FontWeight="Bold" Foreground="{StaticResource PhoneBackgroundBrush}" LineHeight="16" />
                        <TextBlock x:Name="CreateTimeBlock" Text="{Binding CreatedAt}" FontSize="20" VerticalAlignment="Bottom" Grid.Column="1" Foreground="{StaticResource PhoneTextBoxReadOnlyBrush}" Margin="0" Height="30"/>
                    </Grid>
                    <TextBlock x:Name="StatusBlock" Text="{Binding text}" TextWrapping="Wrap" FontSize="21.333" Foreground="{StaticResource PhoneBackgroundBrush}" />
                    <Image x:Name="ThumbImage" Source="{Binding thumbnail_pic}" HorizontalAlignment="Left" Stretch="Uniform" Visibility="{Binding IsThumbnail}" Margin="0,12,0,0" VerticalAlignment="Top" Height="120"/>
                    <Border x:Name="RetweetBorder" Margin="0,12,0,0" Padding="8,12" Visibility="{Binding IsRetweetedStatus}" CornerRadius="10" BorderThickness="1" Background="#FFEDEDED" BorderBrush="#FFC2C2C2">
                        <StackPanel>
                            <TextBlock x:Name="RetweetUserBlock" TextWrapping="Wrap" Text="{Binding retweeted_status.user.name}" Margin="0,0,0,10" Foreground="{StaticResource PhoneBackgroundBrush}" FontWeight="Bold"/>
                            <TextBlock x:Name="RetweetStatusBlock" TextWrapping="Wrap" Text="{Binding retweeted_status.text}" Foreground="{StaticResource PhoneBackgroundBrush}"/>
                            <Image x:Name="RetweetThumbImage" 
                                   Margin="0,12,0,0" 
                                   Stretch="Uniform" 
                                   Source="{Binding retweeted_status.thumbnail_pic}" 
                                   Visibility="{Binding retweeted_status.IsThumbnail}" 
                                   HorizontalAlignment="Left" 
                                   VerticalAlignment="Top" 
                                   Height="120"/>
                        </StackPanel>
                    </Border>
                </StackPanel>

                <Grid x:Name="FooterGrid" Margin="0,12,0,0" Grid.Row="1" Grid.Column="1">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <StackPanel x:Name="SourcePanel" Orientation="Horizontal" HorizontalAlignment="Left" d:LayoutOverrides="HorizontalAlignment, GridBox">
                        <Image x:Name="StatusPicHint" Source="/Resources/Images/Status_Pic.png" Visibility="{Binding IsThumbnail}" Margin="0,0,0,-2" Width="30"/>
                        <TextBlock x:Name="SourceBlock"
                        	Text="{Binding Source}" 
                        	d:LayoutOverrides="Width" 
                        	HorizontalAlignment="Left" 
                        	VerticalAlignment="Bottom" 
                        	FontSize="18.667" Foreground="{StaticResource PhoneTextBoxReadOnlyBrush}"/>
                        <Image x:Name="StatusComment" Source="/Resources/Images/Status_Comment.png" Margin="0,0,0,-2" Width="30"/>
                        <TextBlock x:Name="CommentCount"
    						Text="{Binding comments_count}" 
    						d:LayoutOverrides="Width" 
    						HorizontalAlignment="Left" 
    						VerticalAlignment="Bottom" 
    						FontSize="18.667" Foreground="{StaticResource PhoneTextBoxReadOnlyBrush}"/>
                        <Image x:Name="StatusRepost" Source="/Resources/Images/Status_Repost.png" Margin="0,0,0,-2" Width="30"/>
                        <TextBlock x:Name="RepostCount"
    						Text="{Binding reposts_count}" 
    						d:LayoutOverrides="Width" 
    						HorizontalAlignment="Left" 
    						VerticalAlignment="Bottom" 
    						FontSize="18.667" Foreground="{StaticResource PhoneTextBoxReadOnlyBrush}"/>
                    </StackPanel>
                </Grid>

                <Path x:Name="Separater" Data="M0,80 L448,80" Height="1" Margin="0" Grid.Row="2" Grid.ColumnSpan="2" Stretch="Fill" UseLayoutRounding="False" VerticalAlignment="Top" HorizontalAlignment="Center">
                    <Path.Stroke>
                        <SolidColorBrush Color="{StaticResource PhoneForegroundColor}"/>
                    </Path.Stroke>
                </Path>
            </Grid>
        </DataTemplate>
    </phone:PhoneApplicationPage.Resources>

    <phone:PhoneApplicationPage.FontFamily>
        <StaticResource ResourceKey="PhoneFontFamilyNormal"/>
    </phone:PhoneApplicationPage.FontFamily>
    <phone:PhoneApplicationPage.FontSize>
        <StaticResource ResourceKey="PhoneFontSizeNormal"/>
    </phone:PhoneApplicationPage.FontSize>
    <phone:PhoneApplicationPage.Foreground>
        <StaticResource ResourceKey="PhoneForegroundBrush"/>
    </phone:PhoneApplicationPage.Foreground>

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True">
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem x:Name="Discovery" IsEnabled="True" Text="广场" Click="Discovery_Click"/>
                <shell:ApplicationBarMenuItem x:Name="UserSettings" IsEnabled="True" Text="设置" Click="UserSettings_Click"/>
            </shell:ApplicationBar.MenuItems>
            <shell:ApplicationBarIconButton x:Name="refreshIconButton" IconUri="/Resources/Icons/appbar_refresh.png" Text="刷新" Click="refreshIconButton_Click"/>
            <shell:ApplicationBarIconButton x:Name="sendIconButton" IconUri="/Resources/Icons/appbar_edit.png" Text="发送微博" Click="sendIconButton_Click"/>
            <shell:ApplicationBarIconButton x:Name="profileButton" IconUri="/Resources/Icons/appbar_PersonalProfile.png" Text="自己" Click="profileButton_Click"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Style="{StaticResource BackgroundStyle}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <controls:Pivot x:Name ="MainPivot" Title="{StaticResource AppName}" Foreground="{StaticResource PhoneBackgroundBrush}" LoadingPivotItem="MainPivot_LoadingPivotItem" SelectionChanged="MainPivot_SelectionChanged" >
            <!--Pivot1-->
            <controls:PivotItem x:Name="timeline" Header="时间线" Foreground="{StaticResource PhoneBackgroundBrush}" Margin="12,0">
                <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0" Height="531" >
                    <ListBox x:Name="friendsTimeline"
                     ItemsSource="{Binding FriendTimelineList}" 
                     ItemTemplate="{StaticResource StatusTemplateComplex}" Foreground="{StaticResource PhoneBackgroundBrush}" Margin="0,1,0,0" Height="530" HorizontalAlignment="Right" Width="432"
                     SelectionChanged="friendsTimeline_SelectionChanged" />
                </Grid>
            </controls:PivotItem>

            <!--Pivot2-->
            <controls:PivotItem x:Name="mentions" Header="@我的" Foreground="{StaticResource PhoneBackgroundBrush}" Margin="12,0" >
                <Grid x:Name="MentionsPanel" Grid.Row="1" Margin="12,0" Height="531">
                    <Grid Height="60" Margin="0" VerticalAlignment="Top">
                        <RadioButton x:Name="weiboButton" Content="微博" Height="80" Margin="70,0,0,0" BorderBrush="{StaticResource PhoneTextBoxReadOnlyBrush}" Foreground="{StaticResource PhoneTextBoxReadOnlyBrush}"  BorderThickness="1" HorizontalAlignment="Left" VerticalAlignment="Top" Width="140" FontSize="18.667" Click="weiboButton_Click" Background="{StaticResource PhoneForegroundBrush}"/>
                        <RadioButton x:Name="commentButton" Content="评论" Height="80" Margin="0,0,45,0" BorderBrush="{StaticResource PhoneTextBoxReadOnlyBrush}" Foreground="{StaticResource PhoneTextBoxReadOnlyBrush}" BorderThickness="1" HorizontalAlignment="Right" VerticalAlignment="Top" Width="140" FontSize="18.667" Click="commentButton_Click"/>
                        <Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Margin="69,16,0,-6" Width="113"/>
                        <Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Right" Margin="0,16,73,-6" Width="113"/>
                    </Grid>
                    <ListBox x:Name="mentionsTimeline"
                     ItemsSource="{Binding MentionTimelineList}" 
                     ItemTemplate="{StaticResource StatusTemplateComplex}" Foreground="{StaticResource PhoneBackgroundBrush}" Margin="0,80,0,0" Height="530" HorizontalAlignment="Right" Width="432" />
                    <ListBox x:Name="commentmentionsTimeline"
                     ItemsSource="{Binding CommentMentionTimelineList}" 
                     ItemTemplate="{StaticResource CommentTemplateComplex}" Foreground="{StaticResource PhoneBackgroundBrush}" Margin="0,80,0,0" Height="530" HorizontalAlignment="Right" Width="432" Visibility="Collapsed"/>
                </Grid>
            </controls:PivotItem>

            <!--Pivot3-->
            <controls:PivotItem x:Name="comments" Header="评论" Foreground="{StaticResource PhoneBackgroundBrush}">
                <Grid x:Name="CommentsPanel" Grid.Row="1" Margin="12,0" Height="531">
                    <Grid Height="60" Margin="0" VerticalAlignment="Top">
                        <RadioButton x:Name="toMe" Content="收到" Height="80" Margin="70,0,0,0" BorderBrush="{StaticResource PhoneTextBoxReadOnlyBrush}" Foreground="{StaticResource PhoneTextBoxReadOnlyBrush}"  BorderThickness="1" HorizontalAlignment="Left" VerticalAlignment="Top" Width="140" FontSize="18.667" Click="toMe_Click" Background="{StaticResource PhoneForegroundBrush}"/>
                        <RadioButton x:Name="byMe" Content="发出" Height="80" Margin="0,0,45,0" BorderBrush="{StaticResource PhoneTextBoxReadOnlyBrush}" Foreground="{StaticResource PhoneTextBoxReadOnlyBrush}" BorderThickness="1" HorizontalAlignment="Right" VerticalAlignment="Top" Width="140" FontSize="18.667" Click="byMe_Click"/>
                        <Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Margin="69,16,0,-6" Width="113"/>
                        <Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Right" Margin="0,16,73,-6" Width="113"/>
                    </Grid>
                    <ListBox x:Name="commentsToMe"
                     ItemsSource="{Binding CommentsToMe}" 
                     ItemTemplate="{StaticResource CommentTemplateComplex}" Foreground="{StaticResource PhoneBackgroundBrush}" Margin="0,80,0,0" Height="530" HorizontalAlignment="Right" Width="432" />
                    <ListBox x:Name="commentsByMe"
                     ItemsSource="{Binding CommentsByMe}" 
                     ItemTemplate="{StaticResource CommentTemplateComplex}" Foreground="{StaticResource PhoneBackgroundBrush}" Margin="0,80,0,0" Height="530" HorizontalAlignment="Right" Width="432" Visibility="Collapsed"/>
                </Grid>
            </controls:PivotItem>

            <!--Pivot4-->
            <controls:PivotItem x:Name="favorite" Header="收藏" Foreground="{StaticResource PhoneBackgroundBrush}">
                <Grid x:Name="FavoritePanel" Grid.Row="1" Margin="12,0" Height="531" >
                    <ListBox x:Name="favorites"
                     ItemsSource="{Binding FavoritesList}" 
                     ItemTemplate="{StaticResource FavoritesTemplateComplex}" Foreground="{StaticResource PhoneBackgroundBrush}" Margin="0,1,0,0" Height="530" HorizontalAlignment="Right" Width="432" />
                </Grid>
            </controls:PivotItem>
        </controls:Pivot>
        <!--TitlePanel contains the name of the application and page title
		<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
			<TextBlock x:Name="ApplicationTitle" Text="{StaticResource AppName}" Style="{StaticResource PhoneTextNormalStyle}" Foreground="{StaticResource PhoneBackgroundBrush}"/>
			<TextBlock x:Name="PageTitle" Text="Timeline" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}" Foreground="{StaticResource PhoneBackgroundBrush}"/>
		</StackPanel>->

		ContentPanel - place additional content here-->

    </Grid>

</phone:PhoneApplicationPage>